# 一个装饰器的作用 -->一个函数运行时间
import time


def last_time(func):
    def inner():
        start = time.time()
        func()
        end = time.time()
        return end - start

    return inner


@last_time
def test():
    print('doing---')
    # time.sleep(3)
    for i in (x for x in range(1000000)):
        print(i)
    print('doing--------------')


spand = test()
print(spand)
